#ifndef _XMW_CONFIG_H
#define _XMW_CONFIG_H

/* Supported config file version */
#define XMW_CONFIG_VERSION "0.1.2"

/* Single bot declaration */
typedef struct {
	char *jid;
	char *command;
} xmw_bot_t;

/* Bots array with size */
typedef struct {
	int size;
	xmw_bot_t *bots;
} xmw_bots_array;

/* Connection definition */
typedef struct {
	char *name;
	char *type;
	char *server;
	char *user;
	char *password;
	char *resource;
} xmw_connection_t;

/* Connections array */
typedef struct {
	int size;
	xmw_connection_t *connections;
} xmw_connections_array;

/* Entire config */
typedef struct {
	xmw_connections_array connections;
	xmw_bots_array bots;
} xmw_config_t;

/* Parse config file specified by path */
extern xmw_config_t xmw_config_parse(const char* config_file);

/* Free memory previously allocated by xmw_config_parse() */
extern void xmw_config_free(xmw_config_t *bots);

#endif /* _XMW_CONFIG_H */
